﻿/***************************************************************************************************
  Copyright(C)   2011-8-24
  All rights reserved.
  File Name: windowblindsitem.h

  Description:百叶窗图片播放方式实现模块

  ***************************************************************************************************/


#ifndef WINDOWBLINDSITEM_H
#define WINDOWBLINDSITEM_H

#include <QLabel>
#include <QTimer>
#include <QTimeLine>
#include <QImage>

class WindowBlindsItem : public QLabel
{
    Q_OBJECT
public:
    explicit WindowBlindsItem(QWidget *parent = 0);

    ~WindowBlindsItem();

    void setImage(const QImage& image);
    void startDraw(const int timeID);
    void stopDraw();

protected:
    void paintEvent(QPaintEvent *);


private:
    QImage mDrawImage;
    QImage mCurrentImage;
    QTimeLine *mTimeLine;

    int mCurrentWidth;


private slots:
    void timeLineSlot(int iVal);

};

#endif // WINDOWBLINDSITEM_H
